Method for Determining Compressed State Sequences

ABSTRACT

A compressed state sequence s is determined directly from the input sequence of data x. A deterministic function ƒ(x) only tracks unique state transitions, and not the dwell times in each state. A polynomial time compressed state sequence inference method outperforms conventional compressed state sequence inference techniques.

FIELD OF THE INVENTION

This invention relates generally to a method for determining a state sequences from an input sequence of data, and more particularly to determining a compressed state sequence.

BACKGROUND OF THE INVENTION

Assigning labels to sequential data is a common problem in applications such as speech recognition, computational linguistic, computer vision, and robotics. For example, analyzing parts of speech, the task is to tag a sequence of words by considering the grammatical structure of the language, e.g., verb-verb-noun-noun-verb-adjective is a very unlikely grammatical sequence in English, while noun-verb-adverb is not. Similarly, in speech recognition, words or phonemes obey certain pronunciation rules of the underlying language, particularly as to their sequential order.

Likewise, one can assign letters and numbers to a sequence of hand-written characters by exploiting the structure enforced by the grammar of the underlying language. In these examples, sequential patterns are important and can be exploited to extract information from large data sets.

Two common model for solving such problems are hidden Markov models (HMMs), and conditional random fields (CRFs). Although these models are very powerful, different types of data require modifications specific to applications, resulting in various extensions of the models.

For example, a semi-Markovian CRF is a more general solution for a segmentation problem allowing non-Markovian state transitions in segments of data and assigning labels directly to the sequences, instead individual samples.

Another method describes non-parametric prior probabilities for systems with state persistence to prevent unrealistic state transitions. That method provides state persistence, and also allows training the transition probabilities in an infinite state space. In the above examples, the basic task of the final state sequence inference is to estimate a precise state sequence.

However, in many applications, that is not a necessary goal. Instead, the goal is to estimate some deterministic function of the state sequence. Particularly, the goal is to track the state transitions without accounting for the dwell times in each state.

In an example application, the movement of a person is tracked when exact transitions between states such as “sitting (s),” “jumping (j),” “walking (w),” and “running (r),” are ambiguous and not important, but the detection of unique sequence of states that occurred in a specified order is important.

For example, a ground truth example state sequence of human movement is y={s, s, j, j, j, w, w, r, r}, and an input sequence of data is x={x₁, x₂, . . . , x₉}. The goal is to accurately predict the output of a deterministic function compress, where compress(y)={s, j, w, r}. That is, duplicate states are removed in the compressed sequence.

Moreover, when a predicted state sequence y′={s, s, j, j, j, j, w, r, r} is acquired by converting the first occurrence of the state ‘w’ to ‘j’ exactly at the transition from j to w, it is an error for conventional applications, but it is not an error for in an application with compressed state sequence inference, because compress(y)=compress(y′).

Inversely, when a predicted sequence is y″={s, s, j, j, w, j, w, r, r}, it is a fatal error for this application, even though it is only one state different from y. Here, state transition ambiguity is not the only feature of the problem, but the length of the compressed output is unknown and arbitrary, e.g., it is unclear how many unique actions occurred in the order of appearance during the movement of human.

There are several other problems that require such a special treatment in state sequence inference, including state counting processes in which one is interested in counting unique states in a sequence without considering the dwell times. To the best of our knowledge, this is a problem largely unaddressed in machine learning applications.

Compressed sequences have been described for a video-interpretation application. Exact state transitions are ambiguous and only distinct states are important for the video-interpretation. That method is only applicable to a very limited domain and probabilistic models can not be used due to a very high number of states.

In another video interpretation application, a simple transition-cost model is, used, wherein a state transition to the same state is assumed to have no cost, whereas all other possible transitions are assumed to have the same cost K. This is very similar to train a probabilistic sequential model that has zero weight for all transition to the same state, and same cost K as the weight for all other transitions, which is completely unrealistic in many applications, because sequential modeling of state transitions is destroyed.

FIG. 1 shows a conventional compressed state sequence inference method. Given the input sequence of data x={x₁, x₂, . . . , x_(T)} 101 and previously trained HMM/CRF parameters {λ_(j), μ_(k)} 106, a HMM/CRF decoding method 102 predicts a complete state sequence y={y₁, y₂, . . . , y_(T)} 103 that corresponds to the data 101. Here, the increments of the index T are time steps. Then, a deterministic compress function ƒ 104 is applied to the complete state sequence 103 to determine a compressed sequence of unique states s=ƒ(y)={s₁, s₂, . . . , s_(c)} 105. In the compressed state sequence, all duplicate states in the complete state sequence 103 are removed.

SUMMARY OF THE INVENTION

Hidden Markov models (HMMs) and conditional random fields (CRFs) are two popular techniques for modeling sequential data x. State sequence inference procedures using CRFs and HMMs enable the estimation of a state sequence y, given the input sequence of data x.

However, in many applications, estimation of the precise (complete) state sequence is not a necessary goal. Instead, the goal is to estimate some deterministic function ƒ of the state sequence x to obtain a compressed state sequence y. In such applications, estimating the state sequence by conventional state sequence inference techniques, and then determining the functional mapping from the estimate is not necessarily optimal.

Therefore, the invention determines the compressed state sequence s directly from the input sequence of data x.

In particular, we consider the specific problem where the deterministic function ƒ(x) only tracks unique state transitions and not the dwell times in each state.

We provide a polynomial time compressed state sequence inference method that outperforms conventional compressed state sequence inference techniques. The problem we solve commonly arises in many disparate applications, such as robot tracking, character, handwriting and speech recognition.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of conventional HMM/CRF decoding followed by applying a deterministic function ƒ, which produces compressed state sequence;

FIGS. 2A-2B are block diagrams of compressed HMM/CRF decoding, which directly outputs the compressed state sequence according to embodiments of the invention;

FIGS. 3A-3C are schematics of the compressed state sequence inference method according to embodiments of the invention;

FIGS. 4A-4B are schematics of robot location tracking application according to embodiments of the invention; and

FIG. 4C is a graph of the motion as a function of time.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

FIGS. 2A and 2B shows a compressed state sequence inference method according to embodiments of our invention. Given the input sequence of data x={x₁, x₂, . . . , x_(T)} 201, wherein the data are indexed by T. For example, the sequence is a time series. Using parameters {λ_(j), μ_(k)} 204 of a trained HMM or CRF model, a compressed decoding method 202 directly outputs an estimated compressed state sequence s={s₁, s₂, . . . , s_(c)} 203. The steps of the method can be performed in a processor 200 connected to a memory and input/output interfaces as known in the art.

Conditional Random Fields and State Sequence Inference Techniques

Linear-chain conditional random fields CRFs and hidden Markov models (HMMs) are two probabilistic models that can be used for labeling sequential data. After the data are labeled, state sequences can be determined. Linear-chain CRFs and HMMs can be used interchangeably depending on a the selected feature function. We focus on procedures for CRFs.

However, the procedures are equally applicable to HMMs. It not important for our method which particular model we are use, i.e., results can be generalized from one to the other. Although, we use linear-chain CRFs in this description, the method is also applicable for HMMs.

Conventional Conditional Random Fields

A linear chain CRF for modeling a conditional distribution p(x|y) can be defined as

$\begin{matrix} {{{p\left( y \middle| x \right)} = {\frac{1}{Z(x)} = {\prod\limits_{t = 1}^{T}{\Psi \left( {y_{t},y_{t - 1},x_{t}} \right)}}}},} & (1) \\ {{{\Psi \left( {{y_{t}.},y_{t - 1},x_{t}} \right)} = {\exp \left\{ {{\sum\limits_{j}{\lambda_{j}{g_{j}\left( {y_{t - 1},y_{t},x} \right)}}} + {\sum\limits_{k}{\mu_{k}{u_{k}\left( {y_{t},x} \right)}}}} \right\}}},} & (2) \end{matrix}$

where Ψ is a potential function, g is a transition feature function from one state to a next state, u is a feature function, λ and μ are parameters estimated by a training process, and Z is a normalization factor, which is a function of the input data sequence.

Conventional State Sequence Inference Techniques

A conventional labeling a data sequence uses a joint density y*=arg max_(y) p(y|x), wherein the function “arg max” returns a maximum. The solution can be determined via a Viterbi procedure using a recursion δ_(t)(j)=max_(i) Ψ(j, i, x_(t))δ _(t−1), which propagates the most likely path based on a maximal product rule. However, in many applications, accurately predicting the complete sequence is very difficult so that individual predictions are used. This can be achieved via predicting y_(i,t) from a marginal distribution p(y_(i,t)|x) by applying a dynamic programming procedure called Forward-Backward. The forward recursion is α_(t)(j)=Σ_(i)Ψ(j, i, x_(t))α_(t−1)(i), where α_(t)(j) are the forward variables, and the backward recursion is β_(t)(i)=Σ_(j)Ψ_(t+1)(j, i, x_(t+1))β_(t+1)(j), where β_(t)(i) are the backward variables. Then, the marginal probabilities can be determined by using these variables.

A constrained forward procedure can be used to determine a confidence in a particular state sequence by constraining the forward recursion to the constrained state sequence. Given a set of constraints Y′={y_(q), . . . , y_(r)}, a modified forward procedure is used to determine the probability of any data sequence satisfying Y′.

The modified forward recursion is

$\begin{matrix} {{{\hat{\alpha}}_{t}\; (j)} = \left\{ \begin{matrix} {\sum\limits_{i}{{\Psi \left( {j,i,x_{t}} \right)}{{\hat{\alpha}}_{t - 1}(i)}}} & {{{for}\mspace{14mu} j} \simeq y_{t + 1}} \\ 0 & {otherwise} \end{matrix} \right.} & (3) \end{matrix}$

for all y_(t+1) 2 Y′, where the operator j≅y_(t+1) is defined as “j conforms to the constraint y _(t+1)”. At index T, the confidence of a specific constraint is Z′/Z, where the constrained lattice factor Z′=Σ_(i){circumflex over (α)}_(T)(i) and the unconstrained lattice factor Z=Σ_(i)α_(T)(i) are determined using the constrained forward variables, and unconstrained forward variables, respectively. Similarly, the same method is followed while estimating a marginal distribution p(y_(i,t)|x) by having a single constraint y_(i,t) in the set Y′.

Compressed State Sequence Inference

The embodiments of the invention provide a method for inferring a compressed sequence of states from acquired data. In one example application for predicting human motion, we define the compressed sequence of states as s=compress(y), where s, j, w, r are arbitrary states. If y={s, s, j, j, j, w, w, r, r}, then s=compress(y)={s, j, w, r}. Hereinafter, we use the symbol

to represent the function compress. Our goal is to predict the compressed sequence s as accurately as possible. We construct a framework for determining the probability p(s|x).

The probability of the compressed state sequence s₀ is given by a marginalization over all segmentations y where the probability of compressed representation s₀ is:

$\begin{matrix} {{{p\left( {s = \left. s_{0} \middle| x \right.} \right)} = {\sum\limits_{{\forall{y:{{(y)}}}} = s_{0}}{p\left( y \middle| x \right)}}},} & (4) \end{matrix}$

the symbol

represents a compress function.

Although determining the probability of p(y|x) is efficient, the summation in Equation (4) includes an exponential number of operations M^(T), where M is the number of states and T is the length of the complete state sequence y, which is intractable. Therefore, we provide a polynomial time procedure for determining p(s=s₀|x) using dynamic programming forward-backward procedure.

We now describe the basic steps of our compressed state sequence inference method.

Determining the Probability p(s=s₀|x)

In Equation (4) there can be an exponential number of possible complete state sequences y corresponding to the compressed sequence s₀. To overcome this problem, we describe tracking transitions in the sequence s while applying the forward recursion.

As shown in FIG. 3A, a length of the sequence s₀ is c=|s₀|. For ease of notation, we refer to individual terms of s₀ as s_(i), i=1, . . . , c. We define a forward variables α _(t)(i), which tracks exactly i−1 transitions in the sequence s₀ up to t. From the index t−1 to index t, the forward variables are updated based on:

-   -   staying in the same state for the input data x_(t) which is         shown with the arrows 311; and     -   making a transition from state s_(i) to S_(i)+1, which is shown         with the arrows 312.

The dynamic programming method is as follows.

The probability p(s=s₀|x) of the sequence s₀, is

${{p\left( {s = \left. s_{0} \middle| x \right.} \right)} = {{\sum\limits_{\forall{y:}}{p\left( y \middle| x \right)}} \propto {\sum\limits_{{\forall{y:{{(y)}}}} = s_{0}}{\prod\limits_{t = 1}^{T}{\Psi \left( {y_{t},y_{t - 1},x_{t}} \right)}}}}},$

which is determined by the recursion:

α _(t)(i)=Ψ(s _(i) ,s _(i−1) ,x _(t)) α _(t−1)(i−1)+Ψ(s _(i) ,s _(i) ,x _(t)) α _(t−1)(i),

where i=1, . . . , c.

At index (time) T, we obtain

${{\overset{\_}{\alpha}}_{T}(c)} = {\sum\limits_{{\forall{y:{{(y)}}}} = s_{0}}{\prod\limits_{t = 1}^{T}{{\Psi \left( {y_{t},y_{t - 1},x_{t}} \right)}.}}}$

By this recursion, we determine the lattice normalization factor Z(s₀)= α _(T)(c). The normalization factor Z converts Z(s₀) to a probability by p(s=s₀|x)=Z(s₀)/Z. The computation of normalization factor Z is described below. The proof of this method is given in the Appendix.

Determining p(c=c₀|x).

Given the input sequence of data x, the first step of determining the compressed sequence s is to determine the length c of the sequence s, where c can take values from 1, which means there is no state transition, up to the sequence length T, which means there is a transition at every single increment. For all c>T, p(c=c₀|x) is zero. The set of compressed state sequences of length i is S _(i) , i.e., S_(i)={s:|s|=i}, for i=1, . . . , T. If S_(i)∩S_(j)=φ, for i≠j, then the probability p(c=c₀|x) is

$\begin{matrix} {{p\left( {c = \left. c_{0} \middle| x \right.} \right)} = {{p\left( {s \in _{c_{0}}} \middle| x \right)} = {{\sum\limits_{{\forall{s^{\prime \;}:{s}}} = c_{0\;}}{p\left( {s = \left. s^{\prime} \middle| x \right.} \right)}} \propto {\sum\limits_{{\forall{s^{\prime}:{s^{\prime}}}} = c_{0}}{\sum\limits_{{\forall{y:{{(y)}}}} = s^{\prime}}{\prod\limits_{t = 1}^{T}{{\Psi \left( {y_{t},y_{t - 1},x_{t}} \right)}.}}}}}}} & (5) \end{matrix}$

The probability of one possible sequence s₀ of length c is p(s=s₀|x). If we have two possible compressed sequences s₁ and s₂, as shown in FIG. 3B, then p(s=s₁|x)=p(s=s₂|x)∝ α _(T)(c)_(s1)+ α _(T)(c)_(s2), where α _(T)(c)_(si) means that the forward recursion was applied for the sequence s_(i). However, these two sequences are different at only one point in the compressed domain. To be able to represent the sequences by the same lattice and avoid multiple calculations, we represent the vector representation of α _(t) in a table. The forward variable α_(t) is M dimensional, and the previous α _(t) is c dimensional. Our {circumflex over (α)}_(t) is c×M dimensional.

The set of all constraints on the lattice is Q={ . . . , q_(l−1), q_(l), q_(l+1), . . . }, where each constraint q_(l) is a tuple of the coordinates of the nonzero entries of the table. For example, for a particular compressed sequence s₀, the set corresponds to {(1, s₁), (2, s₂), . . . , (c, s_(c))}. For a particular set S_(i), the set corresponds to all coordinates of the table with height I, which is denoted by Q

_(i) . The recursion for a given constraint set Q is as follows:

$\begin{matrix} {{{\hat{\alpha}}_{t}\left( {i,j} \right)}_{Q} = \left\{ \begin{matrix} {{{\Psi \left( {j,j,x_{t}} \right)}{{\hat{\alpha}}_{t - 1}\left( {i,j} \right)}_{Q}} + {\sum\limits_{\forall{k:{k \neq j}}}{{\Psi \left( {j,k,x_{t}} \right)}{{\hat{\alpha}}_{t - 1}\left( {{i - 1},k} \right)}_{Q}}}} & {{{if}\mspace{14mu} \left( {i,j} \right)} \in Q} \\ 0 & {{otherwise}.} \end{matrix} \right.} & (6) \end{matrix}$

As shown in FIG. 3B, this recursion propagates through all non-zero entries in the table, and ignores all zero entries, because the zero entries are not included in the lattice Q.

FIG. 3C shows the recursion for which the constraints are included all the locations of the lattice from indices t−1 to t and from t to t+1.

The recursion of Equation (6) determines the probability of all compressed sequences, which are defined by the set Q as

$\begin{matrix} {{{p\left( Q \middle| x \right)} \propto {Z(Q)}} = {\sum\limits_{j}{{\hat{\alpha}}_{T}\left( {c_{0},j} \right)}_{Q}}} & (7) \end{matrix}$

Using constraint set notation

, the probability p(c=c₀|x) is

$\begin{matrix} {{{p\left( {c = \left. c_{0} \middle| x \right.} \right)} \propto {\sum\limits_{{\forall{s:{s}}} = c_{0}}{\sum\limits_{{\forall{y:{{(y)}}}} = s}{\prod\limits_{t = 1}^{T}{\Psi \left( {y_{t},y_{t - 1},x_{t}} \right)}}}}} = {{Z\left( Q_{_{c_{0}}} \right)} = {\sum\limits_{j}{{{\hat{\alpha}}_{T}\left( {c_{0},j} \right)}_{Q_{_{c_{0}}}}.}}}} & (8) \end{matrix}$

This corresponds to applying the recursion in Equation (6) with the constraint set

, and summing the entries at row c₀. As described above, p(c=c₀|x)=0 when c₀>T or c₀<1. If we do this procedure for the constraint set Q

_(T) , the row sums of the table {circumflex over (α)}_(T)(i, j)Q

_(T) produces all the lattice factors Z(Q

_(i) ) concurrently. The summation of this table is equal to the normalizing factor Z, which is necessary for determining p(s=s₀|x)=Z(s₀)=Z and p(c=c₀|x)=Z(

)/Z. This identity follows from the fact that Z is equal to the summation of the lattice factors for all possible lengths and combinations of s.

Determining p(s_(i)=j|x, c)

To determine the marginal distribution p(s_(i)=j|x, c), we construct the constraint set Q_(i,j) by including all the entries of the table with height c except the entries at row i. Then, we add (i, j) to this set. This particular constraint set configuration includes all the possible compressed sequence configurations with length c and s_(i)=j. Then, the marginal probability is p(s_(i)=j|x, c)=Z(Q_(ij))/Σ_(j)Z(Q_(ij)).

Compressed Sequence

The compressed state sequence is then determined by an application of the above steps and maximizing the following:

Estimate c by ĉ=arg max c₀ p(c=c₀|x); and

Estimate s_(j) by ŝ_(j)=arg max_(j) p(s_(j)=j|x, ĉ).

Method for Generating a State Sequence from Data

Following the above, FIG. 2B shows the method 202 in greater detail.

-   -   First, we determine 251 probabilities of lengths c 261 of         possible compressed state sequences corresponding to the input         data sequence x={x₁, x₂, . . . , x_(T)} 201 according to         p=(c|x), wherein i=1, . . . , T.     -   Then, we estimate 252 a length ĉ 262, of the output compressed         state sequence ŝ 203, wherein the length ĉ has a maximum         probability according to arg max p(c|x), wherein a function arg         max returns the maximum probability;     -   Then, we determine 253 a probability of each state s_(j) 263 in         the output compressed state sequence ŝ having the length ĉ         according to p(s_(j)|x, ĉ), wherein j=1, . . . , ĉ; and     -   Finally, we estimate 254 each compressed state ŝ_(j) that has a         maximum probability according to arg max p(s_(j)|x, ĉ) to         estimate the output compressed state sequence ŝ, wherein the         steps are performed in a processor.

Applications

We describe the following applications for our compressed state sequence inference method.

Tracking Location of a Moving Robot

In an application for a moving robot, the robot is tracked in an environment using a grid. Sequential models are frequently used for this purpose particularly to discover the environment. In this application, exact grid repetitions are not important but the compressed version, which indicates the locations traversed in order by the robot, is important.

As shown in FIG. 4A for an example robot application, the robot moves in an environment where the robot can sense the color of a room {blue (B), green (G), yellow (Y), red (r)} and obstacles (block), which prevent motion to that location.

At every step, the robot attempts to move {up, down, left, right}, where the robot selects the direction randomly. If there is an obstacle block in the intended direction, the robot tries again.

FIG. 4B shows an example path 401 for the robot. In this problem, the state refers to the location of the robot in (x, y) coordinates, and an observation refers to an observed color, which is an output of a sensor, e.g., a camera.

FIG. 4C shows the motion, in terms of observed colors, for the path 401 in FIG. 4B, as a function of time. Unfortunately, the color detection accuracy rate can be imperfect, e.g., on average 80%. In this case, although the robot is at a different location, the sensor output is incorrect, as shown by noise 402 in FIG. 4C. However, for a sequence of camera observations, the compressed state sequence inference method predicts the correct locations that the robot traverses in order.

Single Stroke Character Recognition

This application can be used with electronic devices that allow for the input of characters and glyphs using a touch screen, such as smart phones, personal digital assistance (PDAs) and tablet PCs. In general, the problem is to recognize the shape drawn on the touch screen, typically with one continuous stroke.

In this application, state refers to directions {up, right, down, left} and observation refers to quantized angles between successive input points. In general, current systems use stochastic finite state machines or HMMs for this purpose. Usually, the HMM or finite state machine is trained for a single character. Then, one class is selected by a data likelihood test using the models. One drawback of this method is its limited capability of handling arbitrary shapes. One can train a single model for all characters and decode the states by using the model. Nevertheless, a single state error can make the entire prediction erroneous. Hence, we provide a state sequence inference method, which is resistant to noise. Moreover, the ambiguity in state transitions is also a problem, because passing from one state to another is generally ambiguous.

However, our method does not estimate the exact transitions. Instead, our method produces transition sequences, which are sufficient for this task. Given the observations, e.g., quantized angles between successive points acquired from the user interface, our compressed state sequence inference method generates all the directions in order, which is indicative of a particular character.

Handwritten Word Recognition

Recognizing handwriting is generally performed by first segmenting the handwriting, and then recognizing the segments using multi-class classifier, such as a support vector machine (SVM). Often, the grammar of the language is also used. However, it is generally assumed that segmentation is done as a preprocess.

With our method, the characters are not segmented and the lengths of the sequences are not known or required because the handwritten words can have different lengths. The input handwriting is in the form of an image. In this application, each increment corresponds to one vertical column in the image of handwriting, states refer to the corresponding segment, and observations correspond to the shape context features.

While extracting the features, we first take overlapping patches from the image by using a sliding window technique. One patch is taken for each column in the image. Next, we apply a shape context descriptor. Then, we apply K-means clustering to train a dictionary using training data. We also generate histograms for each patch in the trained dictionary, which maps each point extracted from the patches to the cluster centers in the dictionary. The CRF model is trained using histograms of shape context features as observation for each increment and the states corresponds to the character that generates that observation.

While classifying, we-perform the same mapping procedure so that we have a common space with the training set, i.e., histogram space. Given the observations, e.g., histogram of shape context features, determined through a sliding window through the text, compressed state sequence inference predicts the characters in the given word in sequence.

Toll Collection

In an electronic toll collection (ETC) application, the goal is to count the number of tires and trailers of a vehicle using a camera or a 3D sensor. Using these observations over time, the compressed state sequence inference method estimates all the states, e.g., vehicle bodies, tires, towing bars, which provides the information about the number of tires and trailers of the vehicle to determine the toll.

Speech Recognition

In speech recognition, HMMs and conventional state sequence inference methods, such as Viterbi and Forward-Backward, are often used for converting spoken words to text. The underlying states of the audio signal are the phonemes and in general the exact transition point between two states is ambiguous. However, based on the speed of the spoken words, the length of the audio signal can vary for the same word. Compressed state sequence inference decodes the spoken word into phonemes without finding the exact transition points which is sufficient information for speech recognition.

Effect of the Invention

Conventional state sequence inference techniques for CRFs and HMMs focus on a precise prediction, which is not required in some applications where the goal is not to keep track of the dwell times in each state, but rather to track the state transitions. The invention provides a polynomial time state sequence inference procedure explicitly designed to solve this problem.

Although the invention has been described by way of examples of preferred embodiments, it is to be understood that various other adaptations and modifications may be made within the spirit and scope of the invention. Therefore, it is the object of the appended claims to cover all such variations and modifications as come within the true spirit and scope of the invention. 

We claim:
 1. A method for determining an output compressed state sequences ŝ from an input data sequence x, where a probability of the compressed state sequence s₀ is given by a marginalization over all segmentations y of the input data sequence according to ${{p\left( {s = \left. s_{0} \middle| x \right.} \right)} = {\sum\limits_{{\forall{y:{{(y)}}}} = s_{0}}{p\left( y \middle| x \right)}}},$ where the symbol

represents a compress function, comprising the steps of: determining probabilities of lengths c of possible compressed state sequences corresponding to the input data sequence x={x₁, x₂, . . . , x_(T)} according to p=(c|x), wherein i=1, . . . , T; estimating a length ĉ, of the output compressed state sequence ŝ, wherein the length ĉ has a maximum probability according to arg max p(c|x), wherein a function arg max returns the maximum probability; determining a probability of each state s_(j) in the output compressed state sequence ŝ having the length ĉ according to p(s_(j)|x, ĉ), wherein j=1, . . . , ĉ; and estimating each compressed state ŝ_(j) that has a maximum probability according to arg max p(s_(j)|x, ĉ) to estimate the output compressed state sequence ŝ, wherein the steps are performed in a processor.
 2. The method of claim 1, wherein the probability of each state s_(j) is a marginal probability, and further comprising: constructing a constraint set Q, wherein the constraint set Q includes the possible transitions in the compressed state sequences, and wherein the marginal probability is Z(Q _(ij))/Σ_(j) Z(Q _(ij)), wherein Z is a normalization factor.
 3. The method of claim 1, wherein the output compressed state sequence track a robot.
 4. The method of claim 1, wherein the output compressed state sequence recognizes a single stroke character.
 5. The method of claim 1, wherein the output compressed state sequence recognizes a handwritten word.
 6. The method of claim 1, wherein the output compressed state sequence counts a number of tires and trailers of a vehicle to determine a toll.
 7. The method of claim 1, wherein the output compressed state sequence recognizes speech.
 8. The method of claim 1, wherein each state in the output compressed state sequence includes a label.
 9. The method of claim 1, wherein the output compressed state sequence is determined using a hidden Markov model.
 10. The method of claim 1, wherein the output compressed state sequence is determined using a conditional random field.
 11. The method of claim 1, wherein the input data sequence is a time series.
 12. The method of claim 2, wherein the marginal probabilities are determined using dynamic programming forward-backward procedure. 